<%@ include file="/WEB-INF/views/commonJSTL.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<fmt:message key="form.selected" var="selected"/>	
<script type="text/javascript">
	$(document).ready(function(){	
	});
	</script>

<form:form method="post" id="formVisitor" commandName="userProvider" enctype="multipart/form-data">   						
	<form:hidden path="provider.providerId" id="providerProviderId"/>
	<form:hidden path="rolProviderId.rolProviderId" value="2"/>
	<form:hidden path="active"/>
														
	<c:set var="showName" scope="page"><fmt:message key="show.form.name"/>.</c:set>																																				                             												
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.name"/>:</label>
		<form:input path="name" id="name" class="required form_input_align letterSpace" maxlength="25" title="${showName}" autofocus="autofocus"/>
		<label class="error"><form:errors path="name" cssClass="error"></form:errors>*</label>
	</div>

	<c:set var="showLastNames" scope="page"><fmt:message key="show.form.lastNames"/>.</c:set>																																				                             						
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.lastName"/>:</label>
		<form:input path="lastName" id="lastName" class="required form_input_align letterSpace" maxlength="25" title="${showLastNames}"/>
		<form:input path="lastName2" id="lastName2" class="form_input_align letterSpace" maxlength="25"/>
		<label class="error"><form:errors path="lastName" cssClass="error"></form:errors>*</label>
	</div>       

	<c:set var="showCI" scope="page"><fmt:message key="show.form.ci"/>.</c:set>																																				                             
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.ci"/> :</label>
		<form:input path="ci" id="ci" class="form_input_align required" minlength='1' maxlength="15" title="${showCI}"/>
		<label class="error"><form:errors path="ci" cssClass="error"></form:errors>*</label>
	</div> 
																																				
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.selected.gender"/> :</label>
		<form:radiobutton path="genero" value="M" checked="checked" id="genero_M" class="required" /><label for="genero_M">&nbsp;<fmt:message key="form.male"/>&nbsp;&nbsp;</label>
		<form:radiobutton path="genero" value="F" id="genero_F" class="required" /><label for="genero_F">&nbsp;<fmt:message key="form.female"/>&nbsp;&nbsp;</label>
	</div> 

	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.cellular"/> :</label>
		<form:input path="cellphone" id="cellphone" class="form_input_align" maxlength="15"/>
	</div>

	<c:set var="showPhone" scope="page"><fmt:message key="show.form.phone"/>.</c:set>																														
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.phone"/> :</label>
		<form:input path="phone" id="phone" class="form_input_align required" minlength='1' maxlength="15" title="${showPhone}"/>
		<label class="error"><form:errors path="phone" cssClass="error"></form:errors>*</label>
	</div>			

	<c:set var="showEmail" scope="page"><fmt:message key="show.form.email"/>.</c:set>																														
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.email"/> :</label>
		<form:input path="email" id="email" class="form_input_align required" minlength='1' maxlength="40" title="${showEmail}"/>
		<label class="error"><form:errors path="email" cssClass="error"></form:errors>*</label>
	</div>

	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.email2"/> :</label>
		<form:input path="email2" id="email2" class="form_input_align" maxlength="40"/>
	</div>
																							
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.address"/> :</label>
		<form:input path="address" id="address" class="form_input_align"/>
	</div>
	<%-- 
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.birthDate"/> :</label>
		<td><input name="birthDate" id="birthDate" class="form_input_align required" readonly="true" onclick="$(this).datepicker({changeMonth: true,changeYear: true,numberOfMonths: 1});$(this).datepicker().datepicker('show');" title="${showBirthdate}"></td>
	</div>  
	 --%>
	<c:set var="showBirthdate" scope="page"><fmt:message key="show.form.birthDate"/>.</c:set>			
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.birthDate"/> :</label>
		<c:set var="temBirthdate" value="" />
		<c:if test="${param._userProviderId != null}">
			<c:set var="partsBirthdate" value="${fn:split(userProvider.birthdate,'-')}" />
			<c:set var="temBirthdate" value="${partsBirthdate[2]}/${partsBirthdate[1]}/${partsBirthdate[0]}" />
		</c:if>
		<form:input path="birthdate" id="birthdate" value="${temBirthdate}" class="form_input_align required" readonly="true" onclick="$(this).datepicker({changeMonth: true,changeYear: true,numberOfMonths: 1});$(this).datepicker().datepicker('show');" title="${showBirthdate}"/>
		<label class="error">*</label>
	</div>	 				

	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.picture"/> :</label>
		<td><input type="file" name="image"></td>
	</div>
	 
	<c:set var="showAccount" scope="page"><fmt:message key="show.form.account"/>.</c:set>																		
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.account"/> :</label>
		<form:input path="login" id="login" class="form_input_align required" minlength='1' maxlength="15" title="${showAccount}"/>
		<label class="error"><form:errors path="login" cssClass="error"></form:errors>*</label>
	</div>

	<c:set var="showPassword" scope="page"><fmt:message key="show.form.password"/>.</c:set>												
	<div style="clear:both;">
		<label class="form_align40"><fmt:message key="form.password"/> :</label>
		<form:input path="password" id="password" class="required form_input_align alphanumeric" maxlength="25" title="${showPassword}"/>
		<label class="error"><form:errors path="password" cssClass="error"></form:errors>*</label>
	</div>
</form:form>